﻿using System;
using System.Windows.Forms;

namespace Library.Util {
  public class AlertForm {


    private static IErrorForm _error;
    public static IErrorForm Error {
      get { return _error ?? (_error = new InnerErrorForm()); }
      set { _error = value; }
    }

    public interface IErrorForm {
      DialogResult Show(string message);
      DialogResult Show(string message, string caption);
      DialogResult Show(string message, string caption, string moreInfo);
    }

    private class InnerErrorForm : DefaultError, IErrorForm {
     



      #region Implementation of IErrorForm

      public DialogResult Show(string message) {
        return Show(message, "Error");
      }

      public DialogResult Show(string message, string caption) {
        return Show(message, caption, String.Empty);
      }

      public DialogResult Show(string message, string caption, string moreInfo) {
        Text = caption;
        txtError.Text = message;
        txtMoreInfo.Text = moreInfo;
        return ShowDialog();
      }

      #endregion
    }
  }
}
